package com.it.plic;

import java.util.concurrent.CountDownLatch;

/**
 * @author げっしょく
 * @date 2021/8/8
 */
public class D2haizi2 extends Thread{
    private CountDownLatch cdl = new CountDownLatch(3);
    public D2haizi2(CountDownLatch cdl) {
        this.cdl = cdl;
    }
    @Override
    public void run() {
        for (int i = 1; i <= 15; i++) {
            System.out.println(getName() + "以及吃完了第"+ i +"个饺子了");
            if (i == 15){
                System.out.println(getName() + "吃饱了");
            }
        }
        cdl.countDown();
    }
}
